package com.cy.pj.common.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
public class JsonResult implements Serializable {
    private static final long serialVersionUID = -7132574947577599624L;
    private int state = 1;
    private String message = "ok";
    private Object data;

    public JsonResult(Object object) {
        this.data = object;
    }

    public JsonResult(String message) {
        this.message = message;
    }

    public JsonResult(Throwable t){
        this.state=0;
        this.message=t.getMessage();
    }
}
